//
//  Dc_CollectionViewCell.m
//  艾薇贝儿
//
//  Created by dllo on 15/9/7.
//  Copyright (c) 2015年 dllo－－邴鹏超. All rights reserved.
//

#import "Dc_CollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "AppDelegate.h"

@implementation Dc_CollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _image=[[UIImageView alloc ]initWithFrame:CGRectMake(0, 0, 100*OffWidth, 100*OffHeight)];
        [_image setBackgroundColor:[UIColor lightGrayColor]];
        
        [self addSubview:_image];
        

        _nameLabel =[[UILabel alloc]initWithFrame:CGRectMake(0, 80*OffHeight, 100*OffWidth, 20*OffHeight)];
        [_nameLabel setBackgroundColor:[UIColor blackColor]];
        [_nameLabel setTextColor:[UIColor whiteColor]];
        [_nameLabel setAlpha:0.6];
        [_image addSubview:_nameLabel];
        
        
        _conLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 100*OffHeight,100*OffWidth, 40*OffHeight)];
    
        _conLabel.font=[UIFont systemFontOfSize:15];
        [_conLabel setNumberOfLines:2];
        [self addSubview:_conLabel];

        
        
    }
    return self;
}
-(void)model:(DcFirstModel *)model{
    _nameLabel.text=model.author;
    _conLabel.text=model.name;
    [_image  sd_setImageWithURL:[NSURL  URLWithString:model.picUrl] placeholderImage:[UIImage imageNamed:@"jia.jpg"]];

   // [_image sd_setImageWithURL:[NSURL URLWithString:model.picUrl]];
}
@end
